import box/{condit,logger,tools}
import.config help_list
shift

alias=()
for i in ${helps[@]};do
  alias+=(${i/_/\/})
done

case $1 in
  list)
    echo "可查看帮助的子命令:"
    printf "%s " ${alias[@]} | Rank-Word
    ;;
  *)
    if [ -z $1 ];then
      echo "用法: help [args]"
      echo "  <name>   子命令"
      echo "  list     列出可查看帮助的子命令"
      echo "显示子命令的用法未指定参数时将显示此帮助"
    else
      Arg=${1/_/\/}
      for ((i=0;i<${#alias[@]};i++));do
        Item=${helps[i]}
        ITEM=${alias[i]}
        if In-Value ITEM == Arg;then
          echo -e "${!Item}"
          exit 0
        fi
      done
      Err "未知的子命令"
    fi
esac
